/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AdminMonitor.java
 *
 * Created on 20/01/2012, 06:06:50 PM
 */

package GUI;

import Control.*;
import java.util.List;

/**
 *
 * @author Andrés 2
 */
public class AdminReportes extends javax.swing.JPanel {

    /** Creates new form AdminMonitor */
    public AdminReportes() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        JRBUsuarios = new javax.swing.JRadioButton();
        JRBMonRadio = new javax.swing.JRadioButton();
        JRBMonTV = new javax.swing.JRadioButton();
        JRBCampañas = new javax.swing.JRadioButton();
        JRBCanales = new javax.swing.JRadioButton();
        JRBEmisoras = new javax.swing.JRadioButton();
        jButton1 = new javax.swing.JButton();
        JRBMarcas = new javax.swing.JRadioButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();

        jLabel1.setFont(new java.awt.Font("Tw Cen MT", 1, 18)); // NOI18N
        jLabel1.setText("GENERACION DE REPORTES");

        JRBUsuarios.setFont(new java.awt.Font("Simplified Arabic Fixed", 2, 14)); // NOI18N
        JRBUsuarios.setText("Usuarios");
        JRBUsuarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JRBUsuarios(evt);
            }
        });

        JRBMonRadio.setFont(new java.awt.Font("Simplified Arabic Fixed", 2, 14)); // NOI18N
        JRBMonRadio.setText("Monitoreos Radio");

        JRBMonTV.setFont(new java.awt.Font("Simplified Arabic Fixed", 2, 14)); // NOI18N
        JRBMonTV.setText("Monitoreos TV");

        JRBCampañas.setFont(new java.awt.Font("Simplified Arabic Fixed", 2, 14)); // NOI18N
        JRBCampañas.setText("Campañas");

        JRBCanales.setFont(new java.awt.Font("Simplified Arabic Fixed", 2, 14)); // NOI18N
        JRBCanales.setText("Canales");

        JRBEmisoras.setFont(new java.awt.Font("Simplified Arabic Fixed", 2, 14)); // NOI18N
        JRBEmisoras.setText("Emisoras");

        jButton1.setFont(new java.awt.Font("Tunga", 0, 14)); // NOI18N
        jButton1.setText("Generar Reporte");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        JRBMarcas.setFont(new java.awt.Font("Simplified Arabic Fixed", 2, 14)); // NOI18N
        JRBMarcas.setText("Marcas");
        JRBMarcas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JRBMarcasActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Tunga", 0, 14)); // NOI18N
        jButton2.setText("Todos");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setFont(new java.awt.Font("Tunga", 0, 14)); // NOI18N
        jButton3.setText("Ninguno");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(76, 76, 76)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JRBMarcas)
                            .addComponent(JRBCanales)
                            .addComponent(JRBUsuarios)
                            .addComponent(JRBMonRadio))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JRBEmisoras)
                            .addComponent(JRBCampañas)
                            .addComponent(JRBMonTV)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(167, 167, 167)
                                .addComponent(jLabel1))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(197, 197, 197)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jButton2)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jButton3)))))
                        .addGap(0, 177, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(31, 31, 31)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JRBUsuarios)
                    .addComponent(JRBCampañas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JRBEmisoras)
                    .addComponent(JRBCanales))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JRBMonTV)
                    .addComponent(JRBMarcas))
                .addGap(15, 15, 15)
                .addComponent(JRBMonRadio)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        Reportes reportes = new Reportes();
        
        if(JRBUsuarios.isSelected()==true){
            UsuarioJpaController usuarioJpaController = new UsuarioJpaController();
            List list = usuarioJpaController.findUsuarioEntities();
            reportes.reporteUsuarios(list);
        }
         if(JRBEmisoras.isSelected()==true){
            EmisoraJpaController emisoraJpaController = new EmisoraJpaController();
            List List = emisoraJpaController.findEmisoraEntities();
            reportes.reporteEmisoras(List);
        
        }
        if(JRBCampañas.isSelected()==true){
            CampañaJpaController campañaJpaController = new CampañaJpaController();
            List List = campañaJpaController.findCampañaEntities();
            reportes.reporteCampañas(List);
        
        }
        if(JRBMonTV.isSelected()==true){
            RegistromonitoreovideoJpaController registromonitoreovideoJpaController = new RegistromonitoreovideoJpaController();
            List List = registromonitoreovideoJpaController.findRegistromonitoreovideoEntities();
            reportes.reporteMonVideo(List);
        
        }
        if(JRBMonRadio.isSelected()==true){
            RegistromonitoreoaudioJpaController registromonitoreoaudioJpaController = new RegistromonitoreoaudioJpaController();
            List List = registromonitoreoaudioJpaController.findRegistromonitoreoaudioEntities();
            reportes.reporteMonRadio(List);
        
        }
        if(JRBCanales.isSelected()==true){
            CanalJpaController canalJpaController = new CanalJpaController();
            List List = canalJpaController.findCanalEntities();
            reportes.reporteCanales(List);
        
        }
        if(JRBMarcas.isSelected()==true){
            MarcaJpaController marcaJpaController = new MarcaJpaController();
            List List = marcaJpaController.findMarcaEntities();
            reportes.reporteMarcas(List);
        
        }
          // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void JRBUsuarios(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JRBUsuarios
        // TODO add your handling code here:
    }//GEN-LAST:event_JRBUsuarios

    private void JRBMarcasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JRBMarcasActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_JRBMarcasActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        JRBCampañas.setSelected(true);
        JRBUsuarios.setSelected(true);
        JRBMonTV.setSelected(true);
        JRBEmisoras.setSelected(true);
        JRBMonRadio.setSelected(true);
        JRBCanales.setSelected(true);
        JRBMarcas.setSelected(true);
                
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        JRBCampañas.setSelected(false);
        JRBUsuarios.setSelected(false);
        JRBMonTV.setSelected(false);
        JRBEmisoras.setSelected(false);
        JRBMonRadio.setSelected(false);
        JRBCanales.setSelected(false);
        JRBMarcas.setSelected(false);// TODO add your handling code here:
    }//GEN-LAST:event_jButton3ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton JRBCampañas;
    private javax.swing.JRadioButton JRBCanales;
    private javax.swing.JRadioButton JRBEmisoras;
    private javax.swing.JRadioButton JRBMarcas;
    private javax.swing.JRadioButton JRBMonRadio;
    private javax.swing.JRadioButton JRBMonTV;
    private javax.swing.JRadioButton JRBUsuarios;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables

}
